package com.autumn.platform.auth.web.access;

import com.autumn.platform.auth.core.access.IPermission;
import com.autumn.platform.auth.core.access.IPermissionMapping;
import com.autumn.platform.core.context.reqeust.IRequest;
import com.autumn.platform.web.request.IWebRequest;

public abstract class AbstractWebPermissionMapping implements IPermissionMapping {

    @Override
    public IPermission lookup(IRequest request) {
        if (request instanceof IWebRequest) {
            return this.lookup((IWebRequest) request);
        }
        return null;
    }

    abstract protected IPermission lookup(IWebRequest request);
}
